The TH and TD elements are used for table cells. TH is used for table header cells while TD is used for table data cells. This distinction gives user agents a means to render such cells distinctly, for instance by using a larger or heavier font for header cells.
ID
An SGML identifier used as the target for hypertext links or for naming particular elements in
associated style sheets. Identifiers are NAME tokens and must be unique within the scope of the current
document.
LANG
This is one of the ISO standard language abbreviations, e.g. "en.uk" for the variety of
English spoken in the United Kingdom. It can be used by parsers to select language specific choices for
quotation marks, ligatures and hyphenation rules. The language attribute is composed from the two letter
language code from ISO 639, optionally followed by a period and a two letter country code from ISO
3166.
CLASS
This a space separated list of SGML NAME tokens and is used to subclass tag names. By
convention, class names are interpreted hierarchically, with the most general class on the left and the most
specific on the right, where classes are separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is recommended that where practical class names should be
picked on the basis of the element's semantics, because this permitsother uses, such as restricting search
through documents by matching on element class names. The conventions for choosing class names are
outside the scope of this document.
COLSPAN
The number of columns spanned by this cell. This allows you to merge cells across columns. It
defaults to 1 (one).
ROWSPAN
The number of rows spanned by this cell. This allows you to merge cells across rows. It defaults to
1 (one).
ALIGN
The ALIGN attribute can be used to explicitly specify the horizontal alignment of paragraphs within
a table row:
DP
This specifies the character to be used for the decimal point with the ALIGN attribute, e.g.
dp="." (the default) or dp=",". The default may be altered by the language context,
as set by the LANG attribute on enclosing elements.
VALIGN
The VALIGN attribute can be used to explicitly specify the vertical alignment of material within a
table cell:
NOWRAP
The NOWRAP attribute is used when you don't want the browser to automatically wrap lines. You
can then explicitly specify line breaks in paragraphs using the BR element.
AXIS
This defines an abbreviated name for a header cell, which can be used when rendering to speech. It
defaults to the cell's content.
AXES
This is a comma separated list of axis names which together identify the row and column headers
that pertain to this cell. It is used when rendering to speech to identify the cell's position in the table. If
missing the user agent can try to follow up columns and left along rows (right for some languages) to find
the corresponding header cells.
<TH> is legal within:
<TR>
The following markup can be used within <TH>
<A>, <ABBREV>, <ACRONYM>, <ADDRESS>, <AU>, <B>,
<BIG>, <BLOCKQUOTE>, <BQ>, <BR>, <CITE>, <CODE>,
<DEL>, <DFN>, <DIR>, <DIV>, <DL>, <EM>, <FIG>,
<FN>, <FORM>, <H1>, <H2>, <H3>, <H4>, <H5>, <H6>,
<HR>, <I>, <IMG>, <INS>, <ISINDEX>, <KBD>, <LANG>,
<MATH>, <MENU>, <NOTE>, <OL>, <P>, <PERSON>, <PRE>,
<Q>, <S>, <SAMP>, <SMALL>, <STRONG>, <SUB>, <SUP>,
<TAB>, <TABLE>, <TT>, <U>, <UL>, <VAR>
<TABLE>
<CAPTION>A nice table</CAPTION>
<TR><TH>This</TH><TH>That</TH></TR>
<TR><TD>1</TD><TD>2</TD></TR>
</TABLE>